package com.jinkaimen.goodcash.ui.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.ht.baselibs.ui.base.BaseActivity;
import com.ht.baselibs.utils.ActivityUtils;
import com.jinkaimen.goodcash.R;

public class TextActivity extends BaseActivity {

    private RelativeLayout rl_underway;
    private TextView tv_title11;
    private TextView iv_shen_he_zhong;
    private TextView tv_title21;
    private TextView iv_yi_shen_he;
    private RelativeLayout rl_over;
    private TextView tv_hint_1;
    private TextView tv_hint_2;
    private ImageView iv_qr;
    private TextView tv_01;

    @Override
    protected boolean isStaticPage() {
        return true;
    }

    @Override
    protected void initTitleBar() {
        mTitleBarView.setTitleText("下载客户端");
    }

    @Override
    protected int initContentView() {
        return R.layout.activity_text;
    }

    @Override
    protected void initChildView() {
        rl_underway = (RelativeLayout) findViewById(R.id.rl_underway);
        tv_title11 = (TextView) findViewById(R.id.tv_title1);
        iv_shen_he_zhong = (TextView) findViewById(R.id.iv_shen_he_zhong);
        tv_title21 = (TextView) findViewById(R.id.tv_title2);
        iv_yi_shen_he = (TextView) findViewById(R.id.iv_yi_shen_he);
        rl_over = (RelativeLayout) findViewById(R.id.rl_over);
        tv_hint_1 = (TextView) findViewById(R.id.tv_hint_1);
        tv_hint_2 = (TextView) findViewById(R.id.tv_hint_2);
        iv_qr = (ImageView) findViewById(R.id.iv_qr);
        tv_01 = (TextView) findViewById(R.id.tv_01);
    }

    @Override
    protected void initChildData() {

    }

    @Override
    protected void setChildViewListener() {
        tv_01.setOnClickListener(this);
        rl_underway.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                tv_title11.setTextColor(getResources().getColor(R.color.black3));
                iv_shen_he_zhong.setVisibility(View.VISIBLE);
                iv_shen_he_zhong.setTextColor(getResources().getColor(R.color.black3));
                tv_title21.setTextColor(getResources().getColor(R.color.yanse_newxian));
                iv_yi_shen_he.setVisibility(View.GONE);
                tv_hint_1.setText("扫描该二维码即可下载【钱包++】");
                tv_hint_2.setText("客户端支持IOS和Android系统");
                iv_qr.setImageResource(R.mipmap.qianbaojiajiaqr);
            }
        });
        rl_over.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                iv_shen_he_zhong = (TextView) findViewById(R.id.iv_shen_he_zhong);
                tv_title21.setTextColor(getResources().getColor(R.color.black3));
                iv_yi_shen_he.setVisibility(View.VISIBLE);
                iv_yi_shen_he.setTextColor(getResources().getColor(R.color.black3));
                tv_title11.setTextColor(getResources().getColor(R.color.yanse_newxian));
                iv_shen_he_zhong.setVisibility(View.GONE);
                tv_hint_1.setText("微信扫描该二维码即可关注");
                tv_hint_2.setText("【商户中心】微信公众号");
                // TODO: 2017/6/8 更改绑定绑定微信公众号的图片
                iv_qr.setImageResource(R.mipmap.qianbaojiajiaqr);
            }
        });
    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
        switch (v.getId()) {
            case R.id.tv_01:
                Bundle bundle = new Bundle();
//                bundle.putLong("report_account_id", mUserId);
//                bundle.putLong("report_shop_id", mShopId);
//                bundle.putBoolean("isPublic", mIsPublic);
                ActivityUtils.startActivity(TextActivity.this, IdentificationShopStep4Activity.class,bundle);
                break;
        }
    }
}
